package string;

/**
 * boolean startsWith(String s ):
 * 判断当前字符串是否是以给定的字符串（s）开始的
 * boolean endWith(String s ):
 * 判断当前字符串是否是以给定的字符串（s）结束的
 */
public class StartsWith {
    public static void main(String[] args) {


        /*String str = "thinking in Java";//java编程思想（java经典书----工具书）
        Boolean starts = str.startsWith("think");//判断str是否是以think开头的
        System.out.println(starts);//true
        Boolean ends =str.endsWith(".png");//判断str是否以.png结尾的
        System.out.println(ends);//false*/


        /*String str = "think in Java";
        boolean starts = str.startsWith("think");
        System.out.println(starts);
        boolean ends = str.endsWith("Java");
        System.out.println(ends);*/


        String str = "think in Java";
        boolean stars = str.startsWith("Think");
        System.out.println(stars);
        String s=  "think in j";
        boolean q = s.endsWith("j");
        System.out.println(q);
    }
}
